how to find the range of a function